<template>
	<div class="dicm">
		<div class="table" v-show="parentDetailData.isTabelShow">
			<div class="container">
				<el-table stripe :data="tableData" border style="width: 100%" ref="multipleTable" v-loading="loading">
					<el-table-column prop="dictCategoryCode" label="编码"></el-table-column>
					<el-table-column prop="dictCategoryDesc" label="内容"></el-table-column>
					<el-table-column prop="createTime" label="创建时间"></el-table-column>
				</el-table>
				<div class="pagination">
					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-sizes="[10, 20, 50]" :page-size="searchcondition.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
					</el-pagination>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import service from '../../../../js/common/dicservice.js';

	export default {
		data() {
			return {
				tableData: [],
				searchcondition: {
					pageNum: 1,
					pageSize: 10,
					parentId: 0
				},
				parentDetailData: {
					isTabelShow: true
				},
				id: 0,
				total: 0,
				title: '新增',
				priDialogFormVisible: false,
				loading: true,
				haspost: false
			}
		},
		created() {
			let self = this;
			self.getDicTypes();
		},
		computed: {
			data() {
				return this.tableData;
			}
		},
		methods: {
			getData() {
				this.getDicTypes();
			},
			handleCurrentChange(val) { //翻页
				this.searchcondition.pageNum = val;
				this.getDicTypes();
			},
			handleSizeChange(val) { //每页数量
				this.searchcondition.pageSize = val;
				this.getDicTypes();
			},
			getDicTypes() {
				let self = this;
				self.httptool.ajaxPost(self.apis.getDicTypes, self.searchcondition, res => {
					self.tableData = self.formattool.trimNull(res.data.list, []);
					self.total = res.data.total;
				});
				self.loading = false;
			}
		}
	}
</script>
<style src="./currentpage.less" lang="less"></style>